<?php slot('contact') ?>
<?php use_stylesheet('/enermaatik/arveldus.css') ?>
<div class="pealkiri">
    <h1><?php echo __('Tagasiside')?></h1>
</div>
<form id="contactform" action="<?php echo LinkGen::getInstance(LinkGen::RAW_ACTION)->link(null, array('module' => 'contact', 'action' => 'submit')) ?>" method="post">
<?php echo $form->renderHiddenFields(true) ?>
<div class="andmerow">
  <div class="arowname">
          <p><?php echo __('Nimi') ?></p>
  </div>
  <div class="aform">
          <div class="aformcontent">
                  <div class="formleft"><img width="10" height="30" alt="" src="/enermaatik/img/formleft.png"></div>
                  <div class="formcenter">
                          <?php echo $form['nimi']->render(array('class' => 'ainput'))?>
                  </div>
                  <div class="formright"><img width="10" height="30" alt="" src="/enermaatik/img/formright.png"></div>
          <div class="clear"></div>

  </div>
  </div>
  <div class="akohustlik">
          <img width="6" height="4" alt="" src="/enermaatik/img/koh.png">
  </div>
  <div class="clear"></div>
</div>

<div class="andmerow">
  <div class="arowname">
          <p><?php echo __('E-mail') ?></p>
  </div>
  <div class="aform">
          <div class="aformcontent">
                  <div class="formleft"><img width="10" height="30" alt="" src="/enermaatik/img/formleft.png"></div>
                  <div class="formcenter">
                          <?php echo $form['email']->render(array('class' => 'ainput'))?>
                  </div>
                  <div class="formright"><img width="10" height="30" alt="" src="/enermaatik/img/formright.png"></div>
          <div class="clear"></div>

  </div>
  </div>
  <div class="akohustlik">
          <img width="6" height="4" alt="" src="/enermaatik/img/koh.png">
  </div>
  <div class="clear"></div>
</div>

<div class="andmerow">
  <div class="arowname">
          <p><?php echo __('Sisu') ?></p>
  </div>
  <div class="aform">
          <div class="aformcontent">
                  <!--<div class="formleft"><img width="10" height="30" alt="" src="/enermaatik/img/formleft.png"></div>!-->
                  <div class="formcenter">
                          <?php echo $form['lisainfo']->render()?>
                  </div>
                  <!--<div class="formright"><img width="10" height="30" alt="" src="/enermaatik/img/formright.png"></div>-->
          <div class="clear"></div>

  </div>
  </div>
  <div class="akohustlik">
          <img width="6" height="4" alt="" src="/enermaatik/img/koh.png">
  </div>
  <div class="clear"></div>
</div><br /><br /><br /><br /><br />
<div class="andmerow">
    <div class="arowname">
          <p><?php echo __('Captcha') ?></p>
    </div>
    <div class="aform">
        <div class="codleft">
                <div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
                <div class="formcenter">
                        <?php $class = 'comcode'?>
                        <?php echo $form['captcha']->render(array('class' => $class   ) )  ?>
                </div>
                <div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
        </div>
        <div class="codright">
                <div id="captcha_refresh" class="refresh"><img src="/enermaatik/img/refresh.png" width="26" height="36" alt=""/></div>
                <div class="codimg"><img id="captcha_image" src="<?php echo url_for('sf_captchagd', array('r' => time() ) ) ?>" width="113" height="36" alt=""/></div>
                <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
</div>
<div class="" style="margin-top: 10px; margin-left: 350px;">
  <div class="hallbuttonleft"><img width="8" height="26" alt="" src="/enermaatik/img/tbl.png"></div>
  <div class="hallbuttoncenter" id="contactSubmit">
          <p><a href="#">Saada</a></p>
  </div>
  <div class="hallbuttonright"><img width="8" height="26" alt="" src="/enermaatik/img/tbr.png"></div>
  <div class="clear"></div>

</div>
</form>

<script type="text/javascript">
  $('#contactSubmit').click(function() {
    $.post($('#contactform').attr('action'), $('#contactform').serialize(), function(data) {
      alert(data);
    });
    //$('#contactform').submit();
    return false;
  });

  $('#captcha_refresh').click(function(e){
          e.preventDefault();
          $('#captcha_image').attr('src','<?php echo url_for('sf_captchagd', array('reload' => 1 ) ) ?>' + '&r=' + Math.random());
          return false;
  });
</script>
<?php end_slot(); ?>